package com.demo.tuling;

import com.demo.tuling.service.A;
import com.demo.tuling.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@SpringBootApplication
@EnableAspectJAutoProxy
public class TulingApplication {

    public static void main(String[] args) {
//        SpringApplication.run(TulingApplication.class, args);
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TulingApplication.class);
//        UserService userService = (UserService) context.getBean("userService");
//        userService.test();
        A a = (A) context.getBean("a");
        a.sayA();
        System.out.println("a = " + a);
    }

}
